//
//  UIResponder+NextResponder.m
//  ResponserChain
//
//  Created by 苏沫离 on 2018/12/1.
//  Copyright © 2018 苏沫离. All rights reserved.
//

#define NSLog(FORMAT, ...)  fprintf(stderr,"%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);


#import "UIResponder+NextResponder.h"

@implementation UIResponder (NextResponder)


- (void)logNextResponder
{
    NSString *string = [NSString stringWithFormat:@"当前responder %@",self.class];
    if ([self isKindOfClass:UIView.class]) {
        string = [NSString stringWithFormat:@"当前responder %@ : %ld",self.class,(long)((UIView *)self).tag];
    }
    
    NSString *string1 = [NSString stringWithFormat:@"nextResponder %@",self.nextResponder.class];
    if ([self.nextResponder isKindOfClass:UIView.class]) {
        string1 = [NSString stringWithFormat:@"nextResponder %@ : %ld",self.nextResponder.class,(long)((UIView *)self.nextResponder).tag];
    }
    
    NSString *string2 = [NSString stringWithFormat:@"%@ ============ %@",string,string1];
    NSLog(@"%@",string2);
}


@end
